Using Custom Fill Methods on BO


Author
Message
StrataFrame Team
S
StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Are you trying to update the Reseller.reseller field?  Or are you trying to just update the fields within the Customers table?
Bradley Marston
Bradley Marston
StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)
Group: Forum Members
Posts: 24, Visits: 119
No I am just trying to do an update in the customers table

the Reseller field from the Select Was used by another apllication

CREATE PROCEDURE UDSP_Customers_GetData
 (  
  @Customer_UID uniqueidentifier = NULL
 Wink
AS

SET NOCOUNT ON

SELECT cs.*, rs.reseller
 FROM Customers cs JOIN
  Reseller rs ON cs.reseller_UID = rs.reseller_UID
 WHERE Customer_UID = @Customer_UID

_________________________________________________________________

CREATE PROCEDURE UDSP_Customers_Update

 @Customer_UID uniqueidentifier ,  
 @CustomerName varchar(50)      = NULL,
 @CustomerStreet varchar(50)    = NULL,
 @CustomerStreet2 varchar(50)    = NULL,
 @CustomerCity varchar(32)      = NULL,
 @CustomerState char(2)         = NULL,
 @CustomerZIP varchar(9)        = NULL,
 @LCon_Name varchar(50)         = NULL,
 @LCon_Phone varchar(20)        = NULL,
 @LCon_Ext varchar(4)           = NULL,
 @LCon_Mobile varchar(20)       = NULL,
 @LCon_Fax varchar(20)          = NULL,
 @LCon_EmailAddr varchar(80)    = NULL,
 @Status char(16)               = NULL,
 @DealerNum char(7)             = NULL,
 @ODNum char(7)                 = NULL,
 @OD2Num char(7)                = NULL,
 @UpdatedBy varchar(16)               ,  
 @CreatedBy varchar(16)         = NULL,
 @Updateddt datetime            = NULL,
 @Createddt datetime            = NULL,
 @Customer_UID_ORGPK uniqueidentifier = NULL,
 @Reseller_UID uniqueidentifier = NULL,
 @reseller varchar(16)         = NULL
)
AS

SET NOCOUNT ON

UPDATE customers SET   
  CustomerName    = ISNULL(@CustomerName, CustomerName),
  CustomerStreet  = ISNULL(@CustomerStreet, CustomerStreet),
  CustomerStreet2  = ISNULL(@CustomerStreet2, CustomerStreet2),
  CustomerCity    = ISNULL(@CustomerCity, CustomerCity),
  CustomerState   = ISNULL(@CustomerState, CustomerState),
  CustomerZIP     = ISNULL(@CustomerZIP, CustomerZIP),
  LCon_Name       = ISNULL(@LCon_Name, LCon_Name),
  LCon_Phone      = ISNULL(@LCon_Phone, LCon_Phone),
  LCon_Ext        = ISNULL(@LCon_Ext, LCon_Ext),
  LCon_Mobile     = ISNULL(@LCon_Mobile, LCon_Mobile),
  LCon_Fax        = ISNULL(@LCon_Fax, LCon_Fax),
  LCon_EmailAddr  = ISNULL(@LCon_EmailAddr, LCon_EmailAddr),
  Status          = ISNULL(@Status, Status),
  DealerNum       = ISNULL(@DealerNum, DealerNum),
  ODNum           = ISNULL(@ODNum, ODNum),
  OD2Num          = ISNULL(@OD2Num, OD2Num),   
  Reseller_UID    = ISNULL(@Reseller_UID, Reseller_UID),  
  UpdatedBy            = UpdatedBy, 
  UpdatedDt            = GETDATE()

 WHERE Customer_UID    = @Customer_UID

StrataFrame Team
S
StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
OK, you can remove the @reseller field from the update command.  The business object will only attempt to update fields that are part of the mapped table (those contained in the AllFieldsList).  Since your business object was mapped to Customers, it does not think that @reseller should be supplied because it doesn't think it's part of the updating table.  So, whatever the structure of the data table inside the business object, it's only going to update the fields that are part of the mapped table on SQL Server.
Bradley Marston
Bradley Marston
StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)StrataFrame Novice (58 reputation)
Group: Forum Members
Posts: 24, Visits: 119
Taking the variable out of the SP does not change anything

the only way to make it work is to change the SP's that get the data and make sure reseller is not in the data returned.

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Are you creating the stored procedure?  If so, what do your CRUD settings look like on your BO?  Last, what does the SP look like?

Note: Please do not post the entire SP text in the text window.  Upload it as an attachment so we can get a more accurate view.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search