BO method for Add new?


(Prakash6738) #1

Which method will applicable on Selecting ‘Yes’ or ‘No’ for Vendor BO ??
i want to disable the creation of new vendor through this way (if not found the new ID)…and enable creation only with ‘New Supplier’ menu.
from File menu.

thanks …:slight_smile:


(Aaron Moreng) #2

Use the trace log to find the method…:slight_smile:


(Brandon Anderson) #3

Clicking on “no” doesn’t show anything different than yes, other than the trace continues.


(Monty Wilson) #4

Maybe Prakash could compare the methods called when a known supplier is entered, to those called when a known supplier is not entered, then something different between the two cases could trigger his error BPM.


(Chris Conn) #5

Problem with trying to avoid that message is that it is baked into the code on change of that controls:

public bool ValidateKeyField(EpiTextBox tb)
{
  //a bunch of system code here.... omitted

    if (!this.isNewRow("VendorDetail") && !this.GetByVendID(text))
    {
        base.SetCurrentEvent(TransactionEvent.AddNewOnPrimaryKey);
        if (this.GetNewVendor())  /* <----     this guy here  */
        {
            tb.Text = text;
            return flag;
        }
        flag = false;
        tb.Text = this.KeyField;
        this.undoChanges();
    }
    return flag;
}


(Mark Wonsil) #6

Hello @Prakash6738,

Just out of curiosity, what are you trying to accomplish? Is this a way to manage Security? To prevent mistaken records?

Mark W.


(Prakash6738) #7

I have created a BPM to create auto incremental VendorID, if any user create a new user by this way as @MontyMan said (Good guess :wink: ) ,i want to restrict the creation. Because the auto increment BPM will fail…as the next ID is already defined in User Code setup.

Thanks


(Prakash6738) #8

And the unknown vendor may be any one…the auto increment BPM wil lost the sequence if below is condition,
Last Vendor ID : 500
next ID -As per my BPM : 501
User creates a new ID : As you said…lets say 505 (becoz its not exists in Vendor table)

It will lost my pre-defined sequence…


(Prakash6738) #9

Clicking on ‘Yes’ will allow you to create new vendor , and ‘No’ keep the screen as it is.


(Brandon Anderson) #10

I meant what the trace shows. The trace doesn’t show you a method to call for “no”


(Prakash6738) #11

Yes, few minuets before i found that…found other method for this yes/now… will let u know…

Thanks