Optimizer: default value on find mode
Giovanni Carletti
Dear all,I looking for a way to solve my problem: when I open a sales order in find mode, I need that customer code field value is 'C001' , because our customer has 80% business with this BP (so usually he wants to find information about him).
I tried with optimizer (Type: SQL, Action: Change values,formtypebase=139, itemuid=4; formtype=139, item=4; )
Nothing happens :roll:
I attach cocu file..
Can you help me? Regards,
giovanni
Attachment
[url=http://www.coresystems.ch/wp-content/../wp-content/forum-file-uploads/cargio/rule.cocu]rule.cocu[/url]
Paolo Manfrin
Buongiorno Giovanni,you should intercept the "Add Mode" opening.
Sales order has
Form ID: 139
CardCode item id: 4
Create a rule with the following parameters:
Action: VALIDATE
Form Type: 1282
Event Type: MenuClick
Form Mode ALL
and choose your preferred language from Type menu. Do not set parameters others than the once mentioned above. I 'm using CSCODE.
Form Type 1282 & Event Type = MenuClick means a Click on the Menu, Item 1282 (Data -> Add).
The C# code should be like:
Form currentForm = Form.GetFormFromUID(SwissAddonFramework.B1Connector.GetB1Connector().Application.Forms.ActiveForm.UniqueID);
if (currentForm.Type == "1282") // only on sales order form
TextEdit.GetFromUID(currentForm, "4").Value = "C001"; // set the value on form 1282, item 4
return true;
This should solve your issue.
Cordiali Saluti,
Paolo
Giovanni Carletti
Hi Paolo,thanks for your explanation: I tried this morning but seems not working... in the afternoon I check again my rule!
Ciao from Mendrisio!
Giovanni
0
Please sign in to leave a comment.
Comments
0 comments