In B1 UP How to get the form number ?
AnsweredHello,
I have done a macro to automatically sort Items Properties in Items Master Data form (Properties tab).
I want also to sort the same universal function/macro in the Item Properties setup form.
I use SortColumn($[$item.col.0]); and my code is
SortColumn($[$129.1.0]|ASC);
SortColumn($[$21.1.0]|ASC);
In order to avoid error and sort the right $[$item.col.0] I need to get the form number so I can write something like
If Form = 150 //Items Master Data
BEGIN
SortColumn($[$129.1.0]|ASC);
END
If Form = 429 //Irem Property setup
BEGIN
SortColumn($[$21.1.0]|ASC);
END
How can I retrieve it?
Thank you
-
Official comment
Hi Patrice,
You need an .NET snippet in order to get this to work. Please see this video https://www.youtube.com/watch?v=YSZ8wMTOLHg which covers the topic.
There is also an example in the comments on how to get the form id.
I hope this helps!
-Thomas
-
Hello Thomas and THANK YOU.
I have seen this viedo before but I cannot get it works, I have an error when clicking on "Find" (that is a button called "add" in the video).
My code is the sample from the video, so basic.
I have noticed that the button "Test compile code is not enabled", probably because when I click on "Find" there is an error.
I have contacted my SAP B1 partner but they do not want to help!
This is why I need help ;=)
-
Hi Patrice,
Unfortunately this is something you need to ask your partner. C# related questions are always paid support (as you can see from your screenshot written in red).
Thanks,
Thomas
-
Hello Thomas,
Yes I know but they do not want to give support. They wrote me:
Unfortunately we can not help you on Code.Net type functions that are solely dedicated to developer.
Applications on Code.Net type functions are not snuff supported by the supportIf anybody can help me I will appreciate a lot.
Sincerely
Patrice
-
Hello Patrice,
In this case you need to request the paid support to your parter, we can't sell directly this service hours. Thank you for your understanding.
-
The correct code to get the form number is :
return form.TypeEx;
Please sign in to leave a comment.
Comments
6 comments