Can anyone give me code to clear a form?
Hi John,
We can use the “oTrans.ClearDataSets();” to clear the screen data.
Hi John,
We can use the “oTrans.ClearDataSets();” to clear the screen data.
Regards, K.SusaiRajsusairajcse@gmail.com susairajcse@gmail.com,
ksrcse@hotmail.com ksrcse@hotmail.com+91 9965414521 , +91 9952912420
Thanks Susai, but that did not work for me. I might be doing it wrong though.
I entered it in Custom Code in a Post-Processing BPM and it said “oTrans” does not exist in the current context.
oTrans.ClearDataSets(); code will work in Customisation C#(Script Editor) code while click the Clear Custom button or any event handler of the Customisation.
You can’t easily clear the form from a BPM it is better to do it in a customization like it has been pointed out.
Thanks. So I can really only do this through customization and not BPM.
Can I get at the code for the message box that appears when you add a new record? I am thinking that I would like to do the clear on the click of Yes before the GetNewCustomer method runs.
Hi John,
There are ways to do it in a BPM, but the question is why would you? What is your end goal here? what’s the overall functionality you are trying to achieve?
I have a BPM that auto generates an ID (Part, Customer, Supplier). In the past, I have made the ID field on the form read only so that users have to use the “New” button to create a new record.
I would like to get away from that and leave the field open so users can type in it and use the predictive search functionality instead of the search button to find existing records.
The problem I have run into is that when a user types something in and the record does not exist, they get the create new message box, and if they click yes it will create the new record with whatever they typed in. In the trace log, I can see that the ID that I put on GetNewCustomer Post-Processing was applied to the dataset, but when you save the record it does not take what I did on the BPM and it creates the record with the user entered ID.
Here is how I am currently auto assigning the ID.
- I have created a User Code Type that holds the User Code for each record type.
- The Code Description holds the next number to generate the ID.
- I have a PostProcessing BPM on the GetNew method for each record that uses the Set Field to make the ID “AutoAssign”.
- I have a PreProcessing BPM on the Update method that if the record is an added row and the ID is “AutoAssign” then it will generate the next ID number and increment the User Code Description.
You can put a pre-processing directive on GetNew which replaces / clears the ID they type in. By the way Epicor provides some limited “Predictive Search” capability out of the box. Have you looked into it yet?
Thanks, I will try that.
Yes, that is the functionality that I would like the users to be able to use. I just need to make sure that the users cannot create an ID around the BPMs I have in place.
That pre-processing directive did not work (probably because I did something wrong).
I tried it as NULL and “” as a Set Field. I also tried to clear the field out through Custom Code.
Whatever was typed in stays on the form and saves as the ID.
Which form is this?
Customer. So, on the GetNewCustomer I have a pre and post processing. The pre I tried to remove what the user entered in the CustID and in the post I am setting the CustID to “AutoAssign”. Funny thing is, if I trace it, the trace shows that the CustID is “AutoAssign” but still saves as what was entered on the form.
Thanks for your help in pointing me in the right direction. I finally figured it out.
I thought through the issue and thought that maybe the dataset was not saved from the GetNew method to the Update method. So I changed my code on the Update method to account for the dataset not saving and it worked!